package hlhj.fhp.checkpoint.presenter

import android.content.Context
import com.example.mymvp.mvp.BasePresenter
import hlhj.fhp.checkpoint.iview.UploadView
import hlhj.fhp.checkpoint.javaBean.MyBaseBean
import hlhj.fhp.checkpoint.module.UoLoadModule
import java.io.File

/**
 * Created by Never Fear   on 2018\11\20 0020.
Never More....
 */
class UpLoadPresenter :BasePresenter<UoLoadModule,UploadView>(), UoLoadModule.UploadListener {
    override fun upResp(myBaseBean: MyBaseBean, tag: Int) {
        view?.uploadResult(myBaseBean, tag)
    }
    fun upload(c:Context,file:File,tag:Int){
        module?.upLoad(c, file, tag)
    }
    fun upload(c:Context,file:File){
        module?.upLoad(c, file, 0)
    }
    override fun createModule() {
        module= UoLoadModule()
        module.listener=this
    }
}